/**
 * 科室
 */
var officeArray = [
  { id: -1, name: '请选择' }, { id: 100000000, name: '眼科' }, { id: 100000001, name: '五官科' }, { id: 100000002, name: '内泌科' }, { id: 100000003, name: '综合科' }, { id: 100000004, name: '体检医生' }, { id: 100000006, name: '全科' }, { id: 100000005, name: '其他' }
];

//医生类型
var typeArray=[
  { id: -1, name: '请选择' }, { id: 1, name: '学术推广医生' }, { id: 3, name: '村医' }
];

/**
 * 职称
 */
var titleArray = [
    { id: -1, name: '请选择' }, { id: 100000000, name: '主任医师或教授' }, { id: 100000001, name: '副主任医师或副教授' }, { id: 100000002, name: '主治医生' }, { id: 100000003, name: '医师' }
];

/**职务 */
var jobArray = [
    { id: -1, name: '请选择' }, { id: 100000000, name: '科主任' }, { id: 100000001, name: '门诊医' }, { id: 100000002, name: '住院医' }
];

/**
 * 性别
 */
var genderArray = [
    { id: 0, name: '请选择' }, { id: 1, name: '男' }, { id: 2, name: '女' }
]

var livenessArray = [
        { id: '', name: '全部' }, { id: 100000000, name: 'A类' }, { id: 100000001, name: 'B类' }, { id: 100000002, name: 'C类' }, { id: null, name: '未开发' }
    ]
    // 手术类型
var operationType = [
    { id: '1', name: '白内障' }, { id: '2', name: '斜视' }, { id: '3', name: '青光眼' }, { id: '4', name: '泪道' }, { id: '5', name: '屈光手术' }, { id: '6', name: '眼底玻切' }
]

function getJobNameByCode(code) {
    var name = '';
    jobArray.forEach(element => {
        if (element.id == code) {
            name = element.name;
        }
    });
    return name;
}

function getOfficeNameByCode(code) {
    var name = '';
    officeArray.forEach(element => {
        if (element.id == code) {
            name = element.name;
        }
    });
    return name;
}

module.exports = {
    officeArray,
    titleArray,
    typeArray,
    jobArray,
    genderArray,
    livenessArray,
    getJobNameByCode,
    getOfficeNameByCode,
    operationType
}